//
//  ZZMyInfoTableViewCell.m
//  ZuZuBao
//
//  Created by Felix on 2024/4/10.
//

#import "ZZMyInfoTableViewCell.h"

@interface ZZMyInfoTableViewCell()

@property (nonatomic, strong) UILabel * titLabel;

@end

@implementation ZZMyInfoTableViewCell
{
    UIView * wView;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = kBackColor;
        // 初始化你的UI组件
        wView = [[UIView alloc] init];
        wView.backgroundColor = [UIColor whiteColor];
        wView.layer.cornerRadius = 12;
        wView.layer.masksToBounds = YES;
        [self.contentView addSubview:wView];
        
        self.titLabel = [[UILabel alloc] init];
        self.titLabel.textColor = k333Color;
        self.titLabel.font = [UIFont boldSystemFontOfSize:16];
        [self.contentView addSubview:self.titLabel];
        
        self.contLabel = [[UILabel alloc] init];
        self.contLabel.textColor = k333Color;
        self.contLabel.font = [UIFont systemFontOfSize:14];
        self.contLabel.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:self.contLabel];
        
        self.imgView = [[UIImageView alloc] init];
        self.imgView.layer.cornerRadius = 23;
        self.imgView.layer.masksToBounds = YES;
        self.imgView.hidden = YES;
        [self.contentView addSubview:self.imgView];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    wView.frame = CGRectMake(kPadding, 12, kScreenWidth - kPadding * 2, self.frame.size.height - 12);
    self.titLabel.frame = CGRectMake(kPadding + 12, 12, 80, wView.frame.size.height);
    self.imgView.frame = CGRectMake(kScreenWidth - kPadding - 12 - 46, wView.center.y - 23, 46, 46);
    self.contLabel.frame = CGRectMake(kScreenWidth - kPadding - 12 - kScreenWidth / 2, 10, kScreenWidth / 2, wView.frame.size.height);
}

-(void)setCellData:(NSString *)text {
    self.titLabel.text = text;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
